function registerRouter(app) {
	const options = {
		moduleCache: {
			vue: Vue
		},
		async getFile(url) {

			const res = await fetch(url);
			if (!res.ok)
				throw Object.assign(new Error(res.statusText + ' ' + url), { res });
			return {
				getContentData: asBinary => asBinary ? res.arrayBuffer() : res.text(),
			}
		},
		addStyle(textContent) {

			const style = Object.assign(document.createElement('style'), { textContent });
			const ref = document.head.getElementsByTagName('style')[0] || null;
			document.head.insertBefore(style, ref);
		},
	}

	const { loadModule } = window['vue3-sfc-loader'];
	//1. 定义路由组件.
	var Home = Vue.defineAsyncComponent(() => loadModule('./sfc/Home.vue', options));
	var BaseHeader = Vue.defineAsyncComponent(() => loadModule('./sfc/BaseHeader.vue', options));
	var BaseSide = Vue.defineAsyncComponent(() => loadModule('./sfc/BaseSide2.vue', options));
	var Test = Vue.defineAsyncComponent(() => loadModule('./sfc/Test.vue', options));
	var BaseLayout = Vue.defineAsyncComponent(() => loadModule('./sfc/BaseLayout.vue', options));
	var NorthCapital = Vue.defineAsyncComponent(() => loadModule('./sfc/NorthCapital.vue', options));

	var NetInflowTop = Vue.defineAsyncComponent(() => loadModule('./sfc/board/NetInflowTop.vue', options));
	var BoardNorthCapital = Vue.defineAsyncComponent(() => loadModule('./sfc/board/BoardNorthCapital.vue', options));
	var NorthCapitalStock = Vue.defineAsyncComponent(() => loadModule('./sfc/board/NorthCapitalStock.vue', options));
	var NorthCapitalStockDetail = Vue.defineAsyncComponent(() => loadModule('./sfc/board/NorthCapitalStockDetail.vue', options));
	
	var ZtgcStock = Vue.defineAsyncComponent(() => loadModule('./sfc/up/ZtgcStock.vue', options));
	var ZrztStock = Vue.defineAsyncComponent(() => loadModule('./sfc/up/ZrztStock.vue', options));
	var choice = Vue.defineAsyncComponent(() => loadModule('./sfc/up/choice.vue', options));

	var TestTable = Vue.defineAsyncComponent(() => loadModule('./sfc/test/TestTable2.vue', options));
	var TestPagination = Vue.defineAsyncComponent(() => loadModule('./sfc/test/TestPagination.vue', options));
	var TestDatePicker = Vue.defineAsyncComponent(() => loadModule('./sfc/test/TestDatePicker.vue', options));
	var TestForm = Vue.defineAsyncComponent(() => loadModule('./sfc/test/TestForm.vue', options));
	var TestMessageBox = Vue.defineAsyncComponent(() => loadModule('./sfc/test/TestMessageBox.vue', options));
	var TestDialog = Vue.defineAsyncComponent(() => loadModule('./sfc/test/TestDialog.vue', options));
	var TestLayout = Vue.defineAsyncComponent(() => loadModule('./sfc/test/TestLayout.vue', options));

	//也可以从其他文件导入
	//const Home = { template: '<div>Home</div>' }

	//2. 定义一些路由
	//每个路由都需要映射到一个组件。
	//我们后面再讨论嵌套路由。
	const routes = [
		{ path: '/', component: Home },
		{ path: '/choice', component: choice },
		{ path: '/test', component: Test },
		{ path: '/NorthCapital', component: NorthCapital },
		{ path: '/NetInflowTop', component: NetInflowTop },
		{ path: '/BoardNorthCapital', component: BoardNorthCapital },
		{ path: '/NorthCapitalStock', component: NorthCapitalStock },
		{ path: '/NorthCapitalStockDetail', component: NorthCapitalStockDetail },
		
		{ path: '/ZtgcStock', component: ZtgcStock },
		{ path: '/ZrztStock', component: ZrztStock },
		
		{ path: '/TestTable', component: TestTable },
		{ path: '/TestPagination', component: TestPagination },
		{ path: '/TestDatePicker', component: TestDatePicker },
		{ path: '/TestForm', component: TestForm },
		{ path: '/TestMessageBox', component: TestMessageBox },
		{ path: '/TestDialog', component: TestDialog },
		{ path: '/TestLayout', component: TestLayout },
	]

	//3. 创建路由实例并传递 `routes` 配置
	//你可以在这里输入更多的配置，但我们在这里
	//暂时保持简单
	const router = VueRouter.createRouter({
		// 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
		history: VueRouter.createWebHashHistory(),
		routes, // `routes: routes` 的缩写
	})
	// 需要定义小写羊肉串格式
	app.component('cc-choice', choice)
	app.component('base-header', BaseHeader)
	app.component('base-side', BaseSide)
	app.component('base-layout', BaseLayout)
	app.component('test-pagination', TestPagination)

	app.component('cc-test', Test)  //必须的吗?
	app.use(router);

}

